<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>新增考试类型</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
	<!-- 引用css -->
	<link type="text/css" rel="stylesheet" href="../bootstrap/css/bootstrap.min.css" />
	<link type="text/css" rel="stylesheet" href="../bootstrap/css/bootstrap-fileinput.css" />
	<link type="text/css" rel="stylesheet" href="../bootstrap/css/bootstrap-datetimepicker.min.css"/>
	<link rel="stylesheet" href="../css/commod.css" type="text/css">
	<link href="../css/css/component.css" rel="stylesheet">
	<!-- 引用js -->
	<script type="text/javascript" src="../bootstrap/js/jquery.min.js"></script>
	<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../bootstrap/js/docs.min.js"></script>
	<script type="text/javascript" src="../bootstrap/js/bootstrap-fileinput.js"></script>
	<script type="text/javascript" src="../bootstrap/js/bootstrap-switch.js"></script>
	
	<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="../bootstrap/js/moment-with-locales.min.js"></script>
	<script type="text/javascript" src="../bootstrap/js/bootstrap-datetimepicker.min.js"></script>
	<script type="text/javascript" src="../bootstrap/jquery.qrcode.min.js"></script>
	
	<!--去掉悬浮窗 -->
	<style type="text/css">#cl-dashboard{display: none}</style>
	
	<link title="" href="../formwork/css/style.css" rel="stylesheet" type="text/css"/>
	<link title="blue" href="../formwork/css/dermadefault.css" rel="stylesheet" type="text/css"/>
	<link title="green" href="../formwork/css/dermagreen.css" rel="stylesheet" type="text/css" disabled="disabled"/>
	<link title="orange" href="../formwork/css/dermaorange.css" rel="stylesheet" type="text/css" disabled="disabled"/>
	<link href="../formwork/css/templatecss.css" rel="stylesheet" title="" type="text/css" />

	<script type="text/javascript" src="../common/util.js"></script>
	<script type="text/javascript" src="../common/page.js"></script>

</head>
<body>
	<div class="container-fluid">
	    <div class="info-center" id="hader_h2">
			<h2>添加考试类型</h2>
	    </div>    
		<div class="col-md-offset-2 col-md-8 underline_div">
	   	   <span class="lead"><strong class="red">*</strong>考试类型基本信息</span>
	    </div>
	   
	   <div class="col-md-offset-2 col-md-6">
	   <form action="" class="form-horizontal" onsubmit="return false">

				<div class="form-group">
					<label for="" class="col-sm-3 control-label">类型名称：</label>
					<div class="col-sm-9">
						<input type="text" name="examName" id="examName"  class="form-control" placeholder="请输入类型名字" />
					</div>
				</div>

				<div class="form-group">
					<label for="" class="col-sm-3 control-label">备注：</label>
					<div class="col-sm-9">
						<textarea rows="4" cols="10" style="resize: none;" class="form-control" placeholder="请输入备注" name="description" id="description"></textarea>
					</div>
				</div>

				<div class="form-group">
					<label for="" class="col-sm-3"></label>
					<div class="col-sm-9">
					<input type="button" onclick="javascript:history.back(-1);" class="btn btn-default" value="返回"/>
						<input type="submit" id="saveType" class="btn btn-primary margin-width" value="保存" />
					</div>
				</div>
	   
	   </form>
	   </div>
	   
	   
	</div>

</body>
<script type="text/javascript">
	$(function () {
        $("#saveType").click(function () {
            var examName = $("#examName").val();
            if (examName == null || examName == "") {
                alert("请输入考试类型名称!");
                return;
			}
            var description = $("#description").val();
            if (description == null || description == "") {
                alert("请输入考试类型描述!");
                return;
            }

            var data = {
                "examName":examName,
                "description":description
            };
            $.ajax({
                url:getRootPath()+'/course/addExamType',
                type:"post",
                dataType:"json",
                data:JSON.stringify(data),
                contentType:"application/json",
                success : function(result) {
                    if (result.status == '0') {
                        window.location.href = getRootPath() + result.uri;
                    } else {
                        alert(result.message)
                    }
                },
                error : function (result) {
                    alert("fail!")
                }
            });
        });
    });
</script>
</html>